package com.qf.lanzhou.blog.api.controller;

import com.qf.lanzhou.blog.api.pojo.entity.Article;
import com.qf.lanzhou.blog.api.service.ArticleService;
import com.qf.lanzhou.blog.api.service.impl.ArticleServiceImp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Yeach-chen
 * @ClassName ArticleParticularsServlet
 */
@WebServlet("/getArticleParams.do")
public class ArticleParticularsServlet extends BaseServletPost {
    private ArticleService articleService=new ArticleServiceImp();
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String articleI = req.getParameter("articleId");
        int articleId = Integer.parseInt(articleI);
        System.out.println("getArticleParamsID:"+articleId);
        Article articlePar = articleService.getArticlePar(articleId);
        successResultWrite(articlePar,resp);
    }
}
